﻿<%@ Page Title="" Language="C#" MasterPageFile="~/subpage.master" AutoEventWireup="true" CodeBehind="mymessage.aspx.cs" Inherits="Nhom14_HTTTHD_BuyMe.mymessage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
<h3>InBox</h3>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSource1" DataKeyNames="id" CellPadding="4" 
        ForeColor="#333333" GridLines="None" ShowHeaderWhenEmpty="True">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="id" HeaderText="ID" InsertVisible="False" 
                ReadOnly="True" SortExpression="id" />
            <asp:BoundField DataField="firstname" HeaderText="Sender" 
                SortExpression="firstname" />
            <asp:BoundField DataField="timestamp" HeaderText="Time" 
                SortExpression="timestamp" />
            <asp:BoundField DataField="message" HeaderText="Content" 
                SortExpression="message" />
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
        <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
        <SortedAscendingCellStyle BackColor="#FDF5AC" />
        <SortedAscendingHeaderStyle BackColor="#4D0000" />
        <SortedDescendingCellStyle BackColor="#FCF6C0" />
        <SortedDescendingHeaderStyle BackColor="#820000" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:WebsitebrokenConnection %>" 
        
        SelectCommand="SELECT message.id, account.firstname, message.timestamp, message.message FROM account INNER JOIN message ON account.id = message.id_from_username WHERE (message.id_to_username = @id)" 
        DeleteCommand="DELETE FROM message WHERE (id = @id)">
        <DeleteParameters>
            <asp:Parameter Name="id" />
        </DeleteParameters>
        <SelectParameters>
            <asp:SessionParameter DefaultValue="0" Name="id" SessionField="user" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    </asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="SidebarContent" runat="server">

    <div class="account">
        <h2>
            My Account</h2>
        <ul>
            <li><a href="myhomepage.aspx">My Websites-Domain</a></li>
            <li><a href="mybid.aspx">My Bibs</a></li>
            <li><a href="mytransaction.aspx">My Transaction</a></li>
            <li><a href="mymessage.aspx">My Messages</a></li>
        </ul>
    </div>
</asp:Content>
